# Maintainer: Daniel Sabogal <dsabogalcc@gmail.com>
pkgname=csfml
pkgver=2.5.2
pkgrel=0
pkgdesc="C bindings for SFML"
url="https://www.sfml-dev.org/"
arch="all"
license="Zlib"
makedepends="cmake doxygen samurai sfml-dev"
subpackages="$pkgname-dev $pkgname-doc"
source="$pkgname-$pkgver.tar.gz::https://github.com/SFML/CSFML/archive/$pkgver.tar.gz"
builddir="$srcdir/CSFML-$pkgver"
options="!check"

build() {
	cmake -B build -G Ninja \
		-DCMAKE_BUILD_TYPE=None \
		-DCMAKE_INSTALL_PREFIX=/usr \
		-DCSFML_BUILD_DOC=TRUE \
		-DCSFML_LINK_SFML_STATICALLY=FALSE \
		-DSFML_DIR=/usr/share/SFML/cmake/Modules
	cmake --build build
}

package() {
	DESTDIR="$pkgdir" cmake --install build

	mkdir -p "$pkgdir"/usr/share/doc
	mv "$pkgdir"/usr/share/CSFML/doc "$pkgdir"/usr/share/doc/CSFML
}

sha512sums="
d651b42e777647d748edf8d2cc40e6df9b0e3fe0f9af5f5c84e9d62ac5bdf6e7e0ff4bb037ee81b59e0bdec544ad05e3b503a4555f03bfa6292a80c6188c12dc  csfml-2.5.2.tar.gz
"
